﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="TouristAgencyAsp.Search" %><%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager runat="server" />
    <asp:Label ID="Label1" runat="server" Text="MaxPrice: "></asp:Label>
    <asp:TextBox ID="maxPriceTxt" runat="server"></asp:TextBox>
    <asp:RangeValidator ID="RangeValidatorAge" runat="server"
                ErrorMessage="Invalid Max Price" 
                ControlToValidate="maxPriceTxt"
                Display="Dynamic"
                ForeColor="Red"
                Type="Double"
                MinimumValue="0"
                MaximumValue="99999999">
             </asp:RangeValidator>
    <asp:Label ID="Label2" runat="server" Text="MinPrice: "></asp:Label>
    <asp:TextBox ID="minPriceTxt" runat="server"></asp:TextBox>
    <asp:RangeValidator ID="RangeValidatorMinPrice" runat="server"
                ErrorMessage="Invalid Min Price" 
                ControlToValidate="minPriceTxt"
                Display="Dynamic"
                ForeColor="Red"
                Type="Double"
                MinimumValue="0"
                MaximumValue="99999999">
             </asp:RangeValidator>
    <br />
    <br />
    <asp:Label ID="Label4" runat="server" Text="Start Date: "></asp:Label>
    <asp:TextBox ID="startTxt" runat="server"></asp:TextBox>
    <asp:RangeValidator ID="RangeValidatorStartDate" runat="server"
                ErrorMessage="Invalid Date" 
                ControlToValidate="startTxt"
                Display="Dynamic"
                ForeColor="Red"
                Type="Date"
                MinimumValue= "<%#DateTime.MinValue.ToShortDateString()%>"
                MaximumValue= "<%#DateTime.MaxValue.ToShortDateString()%> "></asp:RangeValidator>
    <asp:CalendarExtender ID="startDate" runat="server" TargetControlID="startTxt"></asp:CalendarExtender>
    <asp:Label ID="Label5" runat="server" Text="End Date: "></asp:Label>
    <asp:TextBox ID="endTxt" runat="server"></asp:TextBox>
    <asp:RangeValidator ID="RangeValidatorEndDate" runat="server"
                ErrorMessage="Invalid Date" 
                ControlToValidate="endTxt"
                Display="Dynamic"
                ForeColor="Red"
                Type="Date"
                MinimumValue= "<%#DateTime.MinValue.ToShortDateString()%>"
                MaximumValue= "<%#DateTime.MaxValue.ToShortDateString()%> "></asp:RangeValidator>
    <asp:CalendarExtender ID="endDate" runat="server" TargetControlID="endTxt"></asp:CalendarExtender>
    <br />
    <br />
    <asp:Label ID="Label3" runat="server" Text="Destination: "></asp:Label>
    <asp:DropDownList ID="destinationDDL" runat="server">
    </asp:DropDownList>
    <br />
    <br />
    <asp:Button ID="searchBtn" runat="server" Text="Search" 
        onclick="searchBtn_Click" />

    <asp:Repeater ID="resRepeater" runat="server">
        <HeaderTemplate><h2>Results: </h2></HeaderTemplate>
        <ItemTemplate>
            <div class="info">
                <b>Tour Id: <%# Eval("TourId") %></b>
                <br />
                Start Date: <%# Eval("StartDate", "{0:dd/MM/yyyy}") %>
                <br />
                End Date: <%# Eval("EndDate", "{0:dd/MM/yyyy}")%>
                <br />
                Destination:  <%# Eval("Destination.Destination1") %>                           
                <br />
                Price for one person: <%# Eval("Price", "{0:c}") %>
                <br />
            </div>
        </ItemTemplate>
    </asp:Repeater>  
</asp:Content>

